package com.zhuanzhuan.youpin.entity;

/**
 * @author zz.youpin.G_Y
 * @date 2018年6月13日
 * @说明:处理结果状态 1, "处理成功" 0, "处理失败"
 */
public enum EHandleStatus {

    /**
     * 1, "处理成功"
     */
    SUCCESS_STATUS((short)1, "处理成功"),

    /**
     * 0, "处理失败"
     */
    FAILED_STATUS((short)0, "处理失败");

    private Short status;

    private String desc;

    private EHandleStatus(Short status, String desc) {
        this.status = status;
        this.desc = desc;
    }
    public Short status() {
        return status;
    }
    public String desc() {
        return desc;
    }
    public static EHandleStatus of(Short status) {
        for (EHandleStatus item : EHandleStatus.values()) {
            if (item.status().equals(status)) {
                return item;
            }
        }
        throw new IllegalArgumentException("unkonwn HandleStatus: " + status);
    }
}
